function getDotList() {
    var canvas = document.getElementById('canvas_code')
    var ctx = canvas.getContext('2d')
    //在画布的 (50,50) 开始画一个 50x50黑色的矩形，然后获取 (52,52) 点开始 500个像素宽度和高度的图像数据
    ctx.fillStyle = 'green'
    ctx.fillRect(50, 50, 50, 50)
    // 获取像素信息
    let imgData = ctx.getImageData(52, 52, 500, 500)
    console.log(imgData)
    let pixel = imgData.data
    let r = pixel[0]
    let g = pixel[1]
    let b = pixel[2]
    let a = pixel[3] / 255
    a = Math.round(a * 100) / 100
    let rHex = r.toString(16)
    r < 16 && (rHex = '0' + rHex)
    let gHex = g.toString(16)
    g < 16 && (gHex = '0' + gHex)
    let bHex = b.toString(16)
    b < 16 && (bHex = '0' + bHex)
    let rgbaColor = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'
    let rgbColor = 'rgb(' + r + ',' + g + ',' + b + ')'
    let hexColor = '#' + rHex + gHex + bHex
    console.log(rgbaColor)
    console.log(rgbColor)
    console.log(hexColor)
    return {
        rgba: rgbaColor,
        rgb: rgbColor,
        hex: hexColor,
        r: r,
        g: g,
        b: b,
        a: a
    }
}
